import request from '@/utils/request'



// 分页列表查询
export function jobPostingsList(pageNo, pageSize) {
  return request({
    url: 'admin/jobPostings/PageInfo',
    method: 'get',
    params: {
      pageNo,
      pageSize
    }
  })
}

export function jobApplicationsList(pageNo, pageSize) {
  return request({
    url: 'admin/jobApplications/PageInfo',
    method: 'get',
    params: {
      pageNo,
      pageSize
    }
  })
}

// 单个查询
export function updateUserFlagById(id) {
  return request({
    url: '/admin/users/queryById',
    method: 'get',
    params: {
      id
    }
  })
}

// 删除
export function deleteJobPostings(id) {
  return request({
    url: `admin/jobPostings/jobId`,
    method: 'delete',
    params: {
      id
    }
  });
}

export function deleteJobApplications(id) {
  return request({
    url: `admin/jobApplications/id`,
    method: 'delete',
    params: {
      id
    }
  });
}


// 添加方法
export function add(data) {

  return request({
    url: '/admin/users/add',
    method: 'post',
    data
  })
}

// 添加方法
export function updateByState(data) {
  return request({
    url: 'admin/jobPostings/updateByState',
    method: 'post',
    data
  })
}

export function updateByStateJobApplication(data) {
  return request({
    url: 'admin/jobApplications/updateByState',
    method: 'post',
    data
  })
}

export function logout() {
  return request({
    url: '/admin/loginOut',
    method: 'get'
  })
}
